package com.hl.toolkit.server.tycoin.account.slaverepository;

import com.tycoin.account.slaveentity.TycoinUserWallet;
import com.tycoin.common.repository.AbstractRepository;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
@CacheConfig(cacheNames = "com.tycoin.account.slaverepository.tycoinUserWalletRepository")
public interface TycoinUserWalletRepository extends AbstractRepository<TycoinUserWallet, Long> {

	
 	@Query(" select t from TycoinUserWallet t where t.userId=:userId and t.walletType=:walletType  ORDER BY t.createTime  DESC")
	List <TycoinUserWallet> getTycoinUserWalletForType(@Param("userId") String userId, @Param("walletType") String walletType);

 	@Query(" select t from TycoinUserWallet t where t.userId=:userId  ORDER BY t.createTime  DESC")
	List <TycoinUserWallet> getTycoinUserWalletForUser(@Param("userId") String userId);
	
}
